﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>我的IM</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">
    <style>
        .list-block .item-subtitle {
            font-size: 0.5rem;
        }

        .list-block li {
            box-sizing: border-box;
            position: relative;
            margin-bottom: 0rem;
        }
    </style>
</head>
<body>
    <div class="page-group">
        <div id="router" class="page">
            <!-- content应该拥有"pull-to-refresh-content"类,表示启用下拉刷新 -->
            <div class="content pull-to-refresh-content" data-ptr-distance="55">
                <!-- 默认的下拉刷新层 -->
                <div class="pull-to-refresh-layer">
                    <div class="preloader"></div>
                    <div class="pull-to-refresh-arrow"></div>
                </div>
                <!-- 下面是正文 -->
                <div class="list-block media-list" style="margin:0.5rem;">
                    <ul id="MessageUL">
                        <li>
                            <div class="item-content">
                                <div class="item-media">
                                    <img src="img/icon01.jpg" style='width: 2.2rem;' />
                                </div>
                                <div class="item-inner">
                                    <div class="item-title-row">
                                        <div class="item-title">西瓜不太甜</div>
                                    </div>
                                    <div class="item-subtitle">11:00</div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-media">
                                    <img src="img/icon02.jpg" style='width: 2.2rem;' />
                                </div>
                                <div class="item-inner">
                                    <div class="item-title-row">
                                        <div class="item-title">菠萝不太酸</div>
                                    </div>
                                    <div class="item-subtitle">13:15</div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-media">
                                    <img src="img/icon01.jpg" style='width: 2.2rem;' />
                                </div>
                                <div class="item-inner">
                                    <div class="item-title-row">
                                        <div class="item-title">薄荷不太凉</div>
                                    </div>
                                    <div class="item-subtitle">16:23</div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-media">
                                    <img src="img/icon02.jpg" style='width: 2.2rem;' />
                                </div>
                                <div class="item-inner">
                                    <div class="item-title-row">
                                        <div class="item-title">葡萄不太涩</div>
                                    </div>
                                    <div class="item-subtitle">02:18</div>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
    <!-- 默认必须要执行$.init(),实际业务里一般不会在HTML文档里执行，通常是在业务页面代码的最后执行 -->
    <script>
        $(function () {
            $("#MessageUL li").on('click', function (e) {
                location.href = "SendMessage.html?user=" + encodeURI($(this).find('.item-title').html());
            })
        })

        // 添加'refresh'监听器
        $(document).on('refresh', '.pull-to-refresh-content', function (e) {
            // 模拟2s的加载过程
            setTimeout(function () {

                // 加载完毕需要重置
                $.pullToRefreshDone('.pull-to-refresh-content');
            }, 2000);
        });

        $.init();
    </script>
</body>
</html>